package objects
{
	/**
	 * @author rob.thurston
	 */
	public class ReactorDoor extends AbstractObject
	{
		[Embed(source="../assets/assets.swf", symbol="ReactorDoor")]
		protected var ReactorDoorClass : Class;
		
		private var _size : Number;
		private var _isHorizontal : Boolean;
		private var _open : Boolean;

		public function ReactorDoor(yOffset : Number)
		{
			super(yOffset);

			_asset = new ReactorDoorClass();
			addChild(_asset);
		}
		
		public function set size(laserSize : Number) : void
		{
			_size = laserSize;
			_asset.rotation = 0;
			_asset.width = laserSize;
		}
		
		public function set open(isOpen : Boolean) : void
		{
			_open = isOpen;
		}
		
		public function set horizontal(isHorizontal : Boolean) : void
		{
			_isHorizontal = isHorizontal;
			_asset.rotation = (isHorizontal) ? 0 : 90;
		}
		
		override public function getCode() : String
		{
			var code : String = "";
			
			code = "[self addReactorDoor:ccp(" + x + "," + (_yOffset - y) + ") size:" + _size + " horizontal:" + _isHorizontal + " isOpen:" + _open + "]";
			
			return code;
		}
	}
}
